import httpRequest from './request'

/**
 * 获取验证码
 * @returns {*}
 */
export function getCaptcha() {
    return httpRequest({
        url: '/res/captcha',
        method: 'GET'
    })
}

export function addUser(newUserInfo) {
    return httpRequest({
        url: '/api/user/add',
        data: newUserInfo,
        method: 'POST'
    })
}

export function userLogin(loginInfo) {
    return httpRequest({
        url: '/api/user/login',
        data: loginInfo,
        method: 'POST'
    })
}

/**
 * 获取用户信息
 * @returns {*}
 */
export function getUserId() {
    return httpRequest({
        url: '/api/user',
        method: 'GET'
    })
}

/**
 * 根据 id 获取用户信息
 * @returns {*}
 */
export function getUserInfoById() {
    return httpRequest({
        url: '/api/user/1',
        method: 'GET'
    })
}